[FORMAT "WCOFF"]
[INSTRSET "i486p"]
[OPTIMIZE 1]
[OPTION 1]
[BITS 32]
	EXTERN	_get_bpp
	EXTERN	_init_gdtidt
	EXTERN	_init_pic
	EXTERN	_io_sti
	EXTERN	_fifo32_init
	EXTERN	_init_pit
	EXTERN	_init_keyboard
	EXTERN	_enable_mouse
	EXTERN	_io_out8
	EXTERN	_memtest
	EXTERN	_memman_init
	EXTERN	_memman_free
	EXTERN	_init_timerctl
	EXTERN	_init_palette
	EXTERN	_shtctl_init
	EXTERN	_task_init
	EXTERN	_task_run
	EXTERN	_sheet_alloc
	EXTERN	_memman_alloc_4k
	EXTERN	_sheet_setbuf
	EXTERN	_init_screen
	EXTERN	_get_color
	EXTERN	_put_naomi
	EXTERN	_make_balloon
	EXTERN	_putminifonts_asc_sht
	EXTERN	_init_mouse_cursor
	EXTERN	_sheet_slide
	EXTERN	_sheet_updown
	EXTERN	_fifo32_put
	EXTERN	_file_readfat
	EXTERN	_file_search
	EXTERN	_file_loadfile2
	EXTERN	_hankaku
	EXTERN	_memman_free_4k
	EXTERN	_fifo32_status
	EXTERN	_io_cli
	EXTERN	_fifo32_get
	EXTERN	_sheet_free
	EXTERN	_taskctl
	EXTERN	_mouse_decode
	EXTERN	_cons_putstr0
	EXTERN	_asm_end_app
	EXTERN	_keytable0.0
	EXTERN	_wait_KBC_sendready
	EXTERN	_keytable1.1
	EXTERN	_task_sleep
	EXTERN	_change_wtitle
	EXTERN	_task_alloc
	EXTERN	_console_task
	EXTERN	_make_window
	EXTERN	_make_textbox
	EXTERN	_make_omnaomi
[FILE "bootpack.c"]
[SECTION .data]
_keytable0.0:
	DB	0
	DB	1
	DB	49
	DB	50
	DB	51
	DB	52
	DB	53
	DB	54
	DB	55
	DB	56
	DB	57
	DB	48
	DB	45
	DB	94
	DB	8
	DB	9
	DB	81
	DB	87
	DB	69
	DB	82
	DB	84
	DB	89
	DB	85
	DB	73
	DB	79
	DB	80
	DB	64
	DB	91
	DB	10
	DB	0
	DB	65
	DB	83
	DB	68
	DB	70
	DB	71
	DB	72
	DB	74
	DB	75
	DB	76
	DB	59
	DB	58
	DB	0
	DB	0
	DB	93
	DB	90
	DB	88
	DB	67
	DB	86
	DB	66
	DB	78
	DB	77
	DB	44
	DB	46
	DB	47
	DB	0
	DB	42
	DB	0
	DB	32
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	55
	DB	56
	DB	57
	DB	45
	DB	52
	DB	53
	DB	54
	DB	43
	DB	49
	DB	50
	DB	51
	DB	48
	DB	46
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	92
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	92
	DB	0
	DB	0
_keytable1.1:
	DB	0
	DB	0
	DB	33
	DB	34
	DB	35
	DB	36
	DB	37
	DB	38
	DB	39
	DB	40
	DB	41
	DB	126
	DB	61
	DB	126
	DB	8
	DB	9
	DB	81
	DB	87
	DB	69
	DB	82
	DB	84
	DB	89
	DB	85
	DB	73
	DB	79
	DB	80
	DB	96
	DB	123
	DB	10
	DB	0
	DB	65
	DB	83
	DB	68
	DB	70
	DB	71
	DB	72
	DB	74
	DB	75
	DB	76
	DB	43
	DB	42
	DB	0
	DB	0
	DB	125
	DB	90
	DB	88
	DB	67
	DB	86
	DB	66
	DB	78
	DB	77
	DB	60
	DB	62
	DB	63
	DB	0
	DB	42
	DB	0
	DB	32
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	55
	DB	56
	DB	57
	DB	45
	DB	52
	DB	53
	DB	54
	DB	43
	DB	49
	DB	50
	DB	51
	DB	48
	DB	46
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	95
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	0
	DB	124
	DB	0
	DB	0
LC0:
	DB	"My name is naomisan",0x00
LC1:
	DB	"nihongo.fnt",0x00
LC2:
	DB	"osakkie.hsf",0x00
LC4:
	DB	0x0A,"Break(mouse) :",0x0A,0x00
LC3:
	DB	0x0A,"Break(key) :",0x0A,0x00
[SECTION .text]
	GLOBAL	_HariMain
_HariMain:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EDI
	PUSH	ESI
	PUSH	EBX
	LEA	EBX,DWORD [-44+EBP]
	SUB	ESP,1912
	CALL	_get_bpp
	MOV	DWORD [-1824+EBP],0
	MOV	DWORD [-1820+EBP],EAX
	MOV	DWORD [-1828+EBP],0
	MOV	DWORD [-1832+EBP],0
	MOV	DWORD [-1836+EBP],0
	MOV	AL,BYTE [4081]
	SAR	AL,4
	MOV	EDX,EAX
	AND	EDX,7
	MOV	DWORD [-1840+EBP],EDX
	MOV	DWORD [-1844+EBP],-1
	MOV	DWORD [-1856+EBP],0
	MOV	DWORD [-1860+EBP],0
	MOV	DWORD [-1864+EBP],-1
	MOV	DWORD [-1868+EBP],-1
	MOV	DWORD [-1872+EBP],-1
	MOV	DWORD [-1876+EBP],0
	MOV	DWORD [-1880+EBP],0
	MOV	DWORD [-1884+EBP],2147483647
	MOV	DWORD [-1888+EBP],0
	MOV	DWORD [-1892+EBP],0
	MOV	DWORD [-1912+EBP],0
	MOV	DWORD [-1920+EBP],0
	CALL	_init_gdtidt
	CALL	_init_pic
	CALL	_io_sti
	LEA	EAX,DWORD [-588+EBP]
	PUSH	0
	PUSH	EAX
	PUSH	128
	PUSH	EBX
	CALL	_fifo32_init
	MOV	DWORD [4076],EBX
	CALL	_init_pit
	PUSH	256
	PUSH	EBX
	CALL	_init_keyboard
	LEA	EAX,DWORD [-1756+EBP]
	PUSH	EAX
	PUSH	512
	PUSH	EBX
	CALL	_enable_mouse
	ADD	ESP,36
	PUSH	248
	PUSH	33
	CALL	_io_out8
	PUSH	239
	PUSH	161
	CALL	_io_out8
	LEA	ECX,DWORD [-76+EBP]
	PUSH	0
	LEA	EAX,DWORD [-716+EBP]
	PUSH	EAX
	PUSH	32
	PUSH	ECX
	CALL	_fifo32_init
	ADD	ESP,32
	PUSH	-1073741825
	PUSH	4194304
	CALL	_memtest
	PUSH	3932160
	MOV	DWORD [-1812+EBP],EAX
	CALL	_memman_init
	PUSH	647168
	PUSH	4096
	PUSH	3932160
	CALL	_memman_free
	MOV	EAX,DWORD [-1812+EBP]
	SUB	EAX,4194304
	PUSH	EAX
	PUSH	4194304
	PUSH	3932160
	CALL	_memman_free
	ADD	ESP,36
	MOV	EAX,DWORD [-1812+EBP]
	MOV	DWORD [4066],EAX
	CALL	_init_timerctl
	CALL	_init_palette
	MOVSX	EAX,WORD [4086]
	PUSH	EAX
	MOVSX	EAX,WORD [4084]
	PUSH	EAX
	PUSH	DWORD [4088]
	PUSH	3932160
	CALL	_shtctl_init
	PUSH	3932160
	MOV	DWORD [-1896+EBP],EAX
	CALL	_task_init
	PUSH	2
	PUSH	1
	MOV	DWORD [-1816+EBP],EAX
	PUSH	EAX
	MOV	DWORD [-20+EBP],EAX
	CALL	_task_run
	ADD	ESP,32
	MOV	ECX,DWORD [-1816+EBP]
	MOV	EDX,DWORD [-1896+EBP]
	MOV	DWORD [4068],EDX
	MOV	BYTE [189+ECX],0
	PUSH	EDX
	CALL	_sheet_alloc
	MOV	ESI,DWORD [-1820+EBP]
	MOVSX	EDX,WORD [4084]
	SAR	ESI,3
	MOV	DWORD [-1900+EBP],EAX
	MOVSX	EAX,WORD [4086]
	IMUL	EDX,EAX
	IMUL	EDX,ESI
	PUSH	EDX
	PUSH	3932160
	CALL	_memman_alloc_4k
	PUSH	-1
	MOV	EBX,EAX
	MOVSX	EAX,WORD [4086]
	PUSH	EAX
	MOVSX	EAX,WORD [4084]
	PUSH	EAX
	PUSH	EBX
	PUSH	DWORD [-1900+EBP]
	CALL	_sheet_setbuf
	ADD	ESP,32
	MOVSX	EAX,WORD [4086]
	PUSH	EAX
	MOVSX	EAX,WORD [4084]
	PUSH	EAX
	PUSH	EBX
	CALL	_init_screen
	MOV	EAX,DWORD [-1900+EBP]
	OR	DWORD [32+EAX],1
	PUSH	DWORD [-1896+EBP]
	CALL	_sheet_alloc
	MOV	DWORD [-1908+EBP],EAX
	MOV	EAX,ESI
	IMUL	EAX,EAX,728
	PUSH	EAX
	PUSH	3932160
	CALL	_memman_alloc_4k
	PUSH	33924
	PUSH	DWORD [-1820+EBP]
	MOV	EBX,EAX
	CALL	_get_color
	POP	EDX
	POP	ECX
	PUSH	EAX
	PUSH	26
	PUSH	28
	PUSH	EBX
	PUSH	DWORD [-1908+EBP]
	CALL	_sheet_setbuf
	ADD	ESP,44
	PUSH	EBX
	CALL	_put_naomi
	MOV	EDX,DWORD [-1908+EBP]
	OR	DWORD [32+EDX],256
	PUSH	DWORD [-1896+EBP]
	CALL	_sheet_alloc
	MOV	DWORD [-1916+EBP],EAX
	MOV	EAX,ESI
	IMUL	EAX,EAX,2852
	SAL	ESI,8
	PUSH	EAX
	PUSH	3932160
	CALL	_memman_alloc_4k
	PUSH	99
	PUSH	23
	PUSH	124
	PUSH	EAX
	PUSH	DWORD [-1916+EBP]
	CALL	_sheet_setbuf
	ADD	ESP,36
	PUSH	1
	PUSH	19
	PUSH	6
	PUSH	0
	PUSH	0
	PUSH	DWORD [-1916+EBP]
	PUSH	3932160
	CALL	_make_balloon
	PUSH	19
	PUSH	LC0
	PUSH	16777215
	PUSH	0
	PUSH	3
	PUSH	4
	PUSH	DWORD [-1916+EBP]
	CALL	_putminifonts_asc_sht
	ADD	ESP,56
	MOV	ECX,DWORD [-1916+EBP]
	OR	DWORD [32+ECX],256
	PUSH	DWORD [-1812+EBP]
	PUSH	DWORD [-1896+EBP]
	CALL	_open_console
	PUSH	DWORD [-1896+EBP]
	MOV	EDI,EAX
	CALL	_sheet_alloc
	PUSH	ESI
	PUSH	3932160
	MOV	DWORD [-1904+EBP],EAX
	CALL	_memman_alloc_4k
	PUSH	99
	PUSH	16
	MOV	EBX,EAX
	PUSH	16
	PUSH	EAX
	PUSH	DWORD [-1904+EBP]
	CALL	_sheet_setbuf
	ADD	ESP,40
	PUSH	99
	PUSH	EBX
	MOV	EBX,2
	CALL	_init_mouse_cursor
	MOVSX	EAX,WORD [4084]
	LEA	ECX,DWORD [-16+EAX]
	MOV	EAX,ECX
	CDQ
	IDIV	EBX
	MOV	DWORD [-1848+EBP],EAX
	MOVSX	EAX,WORD [4086]
	PUSH	0
	LEA	ECX,DWORD [-16+EAX]
	PUSH	0
	MOV	EAX,ECX
	CDQ
	IDIV	EBX
	PUSH	DWORD [-1900+EBP]
	MOV	DWORD [-1852+EBP],EAX
	CALL	_sheet_slide
	PUSH	16
	PUSH	8
	PUSH	EDI
	CALL	_sheet_slide
	ADD	ESP,32
	MOVSX	EAX,WORD [4086]
	SUB	EAX,70
	PUSH	EAX
	MOVSX	EAX,WORD [4084]
	SUB	EAX,130
	PUSH	EAX
	PUSH	DWORD [-1916+EBP]
	CALL	_sheet_slide
	MOVSX	EAX,WORD [4086]
	SUB	EAX,40
	PUSH	EAX
	MOVSX	EAX,WORD [4084]
	SUB	EAX,50
	PUSH	EAX
	PUSH	DWORD [-1908+EBP]
	CALL	_sheet_slide
	PUSH	DWORD [-1852+EBP]
	PUSH	DWORD [-1848+EBP]
	PUSH	DWORD [-1904+EBP]
	CALL	_sheet_slide
	ADD	ESP,36
	PUSH	0
	PUSH	DWORD [-1900+EBP]
	CALL	_sheet_updown
	PUSH	1
	PUSH	EDI
	CALL	_sheet_updown
	PUSH	2
	PUSH	DWORD [-1908+EBP]
	CALL	_sheet_updown
	PUSH	3
	PUSH	DWORD [-1904+EBP]
	CALL	_sheet_updown
	ADD	ESP,32
	PUSH	EDI
	CALL	_keywin_on
	LEA	EDX,DWORD [-76+EBP]
	PUSH	237
	PUSH	EDX
	CALL	_fifo32_put
	LEA	ECX,DWORD [-76+EBP]
	PUSH	DWORD [-1840+EBP]
	PUSH	ECX
	CALL	_fifo32_put
	PUSH	11520
	PUSH	3932160
	CALL	_memman_alloc_4k
	PUSH	1049088
	MOV	ESI,EAX
	PUSH	EAX
	CALL	_file_readfat
	ADD	ESP,36
	PUSH	224
	PUSH	1058304
	PUSH	LC1
	CALL	_file_search
	ADD	ESP,12
	MOV	EDX,EAX
	TEST	EAX,EAX
	JE	L2
	MOV	EAX,DWORD [28+EAX]
	PUSH	ESI
	MOV	DWORD [-1808+EBP],EAX
	LEA	EAX,DWORD [-1808+EBP]
	PUSH	EAX
	MOVZX	EAX,WORD [26+EDX]
	PUSH	EAX
	CALL	_file_loadfile2
	ADD	ESP,12
	MOV	ECX,EAX
L3:
	MOV	DWORD [-1808+EBP],0
	XOR	EDX,EDX
L13:
	MOV	AL,BYTE [_hankaku+EDX]
	MOV	BYTE [EDX+ECX*1],AL
	MOV	EAX,DWORD [-1808+EBP]
	INC	EAX
	MOV	DWORD [-1808+EBP],EAX
	MOV	EDX,EAX
	CMP	EAX,4095
	JLE	L13
	MOV	DWORD [4072],ECX
	PUSH	224
	PUSH	1058304
	PUSH	LC2
	CALL	_file_search
	ADD	ESP,12
	MOV	EDX,EAX
	TEST	EAX,EAX
	JE	L14
	MOV	EAX,DWORD [28+EAX]
	PUSH	ESI
	MOV	DWORD [-1808+EBP],EAX
	LEA	EAX,DWORD [-1808+EBP]
	PUSH	EAX
	MOVZX	EAX,WORD [26+EDX]
	PUSH	EAX
	CALL	_file_loadfile2
	ADD	ESP,12
	MOV	EBX,EAX
	XOR	EAX,EAX
	MOV	DWORD [-1856+EBP],0
	CMP	EAX,DWORD [-1808+EBP]
	JGE	L164
L20:
	MOV	EDX,DWORD [-1856+EBP]
	MOV	AL,BYTE [EDX+EBX*1]
	CMP	AL,13
	JE	L17
	MOVSX	EAX,AL
	ADD	EAX,256
	PUSH	EAX
	MOV	EAX,DWORD [44+EDI]
	ADD	EAX,16
	PUSH	EAX
	CALL	_fifo32_put
	POP	EAX
	POP	EDX
L17:
	INC	DWORD [-1856+EBP]
	MOV	ECX,DWORD [-1856+EBP]
	CMP	ECX,DWORD [-1808+EBP]
	JL	L20
L164:
	PUSH	DWORD [-1808+EBP]
	PUSH	EBX
	PUSH	3932160
	CALL	_memman_free_4k
	ADD	ESP,12
L14:
	PUSH	11520
	PUSH	ESI
	PUSH	3932160
	CALL	_memman_free_4k
	XOR	EAX,EAX
	MOV	DWORD [-1808+EBP],0
	ADD	ESP,12
	XOR	EDX,EDX
L25:
	INC	EAX
	MOV	DWORD [-1740+EBP+EDX*4],-1
	CMP	EAX,255
	MOV	EDX,EAX
	JLE	L25
	MOV	DWORD [-1808+EBP],256
L26:
	LEA	EBX,DWORD [-76+EBP]
	PUSH	EBX
	CALL	_fifo32_status
	POP	ECX
	TEST	EAX,EAX
	JLE	L29
	CMP	DWORD [-1844+EBP],0
	JS	L176
L29:
	LEA	EBX,DWORD [-44+EBP]
	CALL	_io_cli
	PUSH	EBX
	CALL	_fifo32_status
	POP	EDX
	TEST	EAX,EAX
	JE	L177
	PUSH	EBX
	CALL	_fifo32_get
	MOV	DWORD [-1808+EBP],EAX
	CALL	_io_sti
	POP	EAX
	TEST	EDI,EDI
	JE	L36
	CMP	DWORD [32+EDI],0
	JNE	L36
	MOV	EDX,DWORD [-1896+EBP]
	XOR	EDI,EDI
	MOV	EAX,DWORD [16+EDX]
	CMP	EAX,2
	JE	L36
	MOV	ECX,DWORD [-1896+EBP]
	MOV	EDI,DWORD [12+ECX+EAX*4]
	PUSH	EDI
	CALL	_keywin_on
	POP	ESI
L36:
	MOV	EDX,DWORD [-1808+EBP]
	LEA	EAX,DWORD [-256+EDX]
	CMP	EAX,255
	JBE	L178
	LEA	EAX,DWORD [-512+EDX]
	CMP	EAX,255
	JBE	L179
	LEA	EAX,DWORD [-768+EDX]
	CMP	EAX,255
	JBE	L180
	LEA	EAX,DWORD [-1024+EDX]
	CMP	EAX,999
	JBE	L181
	LEA	EAX,DWORD [-2024+EDX]
	CMP	EAX,255
	JBE	L182
	CMP	EDX,16384
	JNE	L26
	MOV	ECX,DWORD [-1896+EBP]
	MOV	EAX,DWORD [16+ECX]
	MOV	EDI,DWORD [12+ECX+EAX*4]
	JMP	L26
L182:
	IMUL	EAX,EDX,48
	ADD	EAX,DWORD [-1896+EBP]
	PUSH	42240
	PUSH	DWORD [-96108+EAX]
	PUSH	3932160
	LEA	EBX,DWORD [-96108+EAX]
	CALL	_memman_free_4k
	PUSH	EBX
	CALL	_sheet_free
	ADD	ESP,16
	JMP	L26
L181:
	IMUL	EDX,EDX,196
	ADD	EDX,DWORD [_taskctl]
	LEA	EAX,DWORD [-196616+EDX]
	PUSH	EAX
	CALL	_close_constask
L172:
	POP	EAX
	JMP	L26
L180:
	IMUL	EAX,EDX,48
	MOV	EDX,DWORD [-1896+EBP]
	LEA	EAX,DWORD [-35820+EAX+EDX*1]
	PUSH	EAX
	CALL	_close_console
	JMP	L172
L179:
	MOVZX	EAX,BYTE [-1808+EBP]
	PUSH	EAX
	LEA	EAX,DWORD [-1756+EBP]
	PUSH	EAX
	CALL	_mouse_decode
	POP	ECX
	POP	EBX
	TEST	EAX,EAX
	JE	L26
	MOV	EAX,DWORD [-1748+EBP]
	MOV	EDX,DWORD [-1752+EBP]
	ADD	DWORD [-1852+EBP],EAX
	ADD	DWORD [-1848+EBP],EDX
	JS	L183
L93:
	CMP	DWORD [-1852+EBP],0
	JS	L184
L94:
	MOVSX	EAX,WORD [4084]
	DEC	EAX
	CMP	DWORD [-1848+EBP],EAX
	JLE	L95
	MOV	DWORD [-1848+EBP],EAX
L95:
	MOVSX	EAX,WORD [4086]
	DEC	EAX
	CMP	DWORD [-1852+EBP],EAX
	JLE	L96
	MOV	DWORD [-1852+EBP],EAX
L96:
	MOV	ECX,DWORD [-1848+EBP]
	MOV	EAX,DWORD [-1852+EBP]
	MOV	DWORD [-1872+EBP],ECX
	MOV	DWORD [-1876+EBP],EAX
	CMP	DWORD [-1744+EBP],0
	JNE	L98
	CMP	DWORD [-1892+EBP],0
	JE	L97
L98:
	CMP	DWORD [-1864+EBP],0
	JS	L185
L97:
	MOV	EAX,DWORD [-1744+EBP]
	TEST	EAX,1
	JNE	L186
	TEST	EAX,2
	JNE	L187
	TEST	EAX,EAX
	JNE	L26
	TEST	DWORD [-1892+EBP],1
	JE	L149
	MOV	EAX,DWORD [-1892+EBP]
	AND	EAX,3840
	CMP	EAX,256
	JE	L188
L125:
	CMP	DWORD [-1920+EBP],1
	JE	L189
	CMP	DWORD [-1920+EBP],3
	JE	L190
L149:
	MOV	DWORD [-1892+EBP],0
	MOV	DWORD [-1864+EBP],-1
	CMP	DWORD [-1884+EBP],2147483647
	JE	L26
L173:
	PUSH	DWORD [-1888+EBP]
	PUSH	DWORD [-1884+EBP]
	PUSH	DWORD [-1912+EBP]
	CALL	_sheet_slide
	MOV	DWORD [-1884+EBP],2147483647
L174:
	ADD	ESP,12
	JMP	L26
L190:
	MOV	DWORD [-1920+EBP],0
	JMP	L149
L189:
	MOV	DWORD [-1920+EBP],2
	JMP	L149
L188:
	CMP	DWORD [-1860+EBP],4
	JLE	L125
	CMP	DWORD [-1860+EBP],18
	JG	L125
	MOV	EAX,DWORD [-1892+EBP]
	AND	EAX,240
	CMP	EAX,16
	JE	L191
L126:
	MOV	EAX,DWORD [-1892+EBP]
	AND	EAX,240
	CMP	EAX,32
	JE	L192
L130:
	AND	DWORD [-1892+EBP],240
	CMP	DWORD [-1892+EBP],48
	JNE	L125
	PUSH	EDI
	CALL	_keywin_off
	POP	EDX
	MOV	EDX,DWORD [-1896+EBP]
	XOR	EAX,EAX
	ADD	EDX,1044
L145:
	MOV	EDI,EDX
	CMP	DWORD [28+EDX],0
	JS	L193
L141:
	INC	EAX
	LEA	EDX,DWORD [48+EDI]
	CMP	EAX,255
	JLE	L145
	JMP	L125
L193:
	MOV	ECX,DWORD [-1912+EBP]
	MOV	EDX,DWORD [36+EDX]
	CMP	EDX,DWORD [36+ECX]
	JNE	L141
	MOV	ECX,DWORD [-1912+EBP]
	MOV	DWORD [-1740+EBP+EDX*4],-1
	MOV	DWORD [36+ECX],-1
	MOV	DWORD [36+EDI],-1
	PUSH	ECX
	CALL	_sheet_free
	MOV	EAX,DWORD [-1912+EBP]
	PUSH	DWORD [20+EAX]
	MOV	EAX,DWORD [16+EAX]
	SUB	EAX,DWORD [8+EDI]
	ADD	EAX,42
	PUSH	EAX
	PUSH	EDI
	CALL	_sheet_slide
	MOV	ECX,DWORD [-1896+EBP]
	MOV	EAX,DWORD [16+ECX]
	DEC	EAX
	PUSH	EAX
	PUSH	EDI
	CALL	_sheet_updown
	PUSH	EDI
	CALL	_keywin_on
	ADD	ESP,28
	JMP	L125
L192:
	MOV	ECX,DWORD [-1912+EBP]
	MOV	EDX,DWORD [8+ECX]
	LEA	EAX,DWORD [-31+EDX]
	CMP	EAX,DWORD [-1856+EBP]
	JG	L130
	LEA	EAX,DWORD [-21+EDX]
	CMP	DWORD [-1856+EBP],EAX
	JGE	L130
	PUSH	-100
	PUSH	ECX
	CALL	_sheet_updown
	PUSH	EDI
	XOR	EDI,EDI
	CALL	_keywin_off
	PUSH	DWORD [-1912+EBP]
	PUSH	DWORD [-1812+EBP]
	PUSH	DWORD [-1896+EBP]
	CALL	_open_omnaomi
	MOV	EBX,EAX
	MOV	EAX,DWORD [-1912+EBP]
	MOV	EDX,EAX
	PUSH	DWORD [20+EAX]
	MOV	EAX,DWORD [8+EAX]
	ADD	EAX,DWORD [16+EDX]
	SUB	EAX,45
	PUSH	EAX
	PUSH	EBX
	CALL	_sheet_slide
	ADD	ESP,36
	MOV	ECX,DWORD [-1896+EBP]
	MOV	EAX,DWORD [16+ECX]
	CMP	EAX,2
	JLE	L131
	MOV	EDI,DWORD [12+ECX+EAX*4]
	PUSH	EDI
	CALL	_keywin_on
	POP	EAX
L131:
	PUSH	1
	PUSH	EBX
	CALL	_sheet_updown
	POP	ECX
	XOR	EAX,EAX
	POP	ESI
L137:
	CMP	DWORD [-1740+EBP+EAX*4],0
	JS	L169
	INC	EAX
	CMP	EAX,255
	JLE	L137
	JMP	L130
L169:
	MOV	EDX,DWORD [-1912+EBP]
	MOV	DWORD [-1740+EBP+EAX*4],1
	MOV	DWORD [36+EBX],EAX
	MOV	DWORD [36+EDX],EAX
	JMP	L130
L191:
	MOV	ECX,DWORD [-1912+EBP]
	MOV	EDX,DWORD [8+ECX]
	LEA	EAX,DWORD [-20+EDX]
	CMP	EAX,DWORD [-1856+EBP]
	JG	L126
	LEA	EAX,DWORD [-5+EDX]
	CMP	DWORD [-1856+EBP],EAX
	JGE	L126
	MOV	EBX,DWORD [44+ECX]
	TEST	BYTE [32+ECX],16
	JE	L127
	MOV	AL,BYTE [188+EBX]
	MOV	BYTE [189+EBX],AL
	MOV	EDX,DWORD [-1816+EBP]
	MOVZX	ESI,BYTE [189+EDX]
	MOV	BYTE [189+EDX],AL
	PUSH	LC4
	PUSH	DWORD [164+EBX]
	CALL	_cons_putstr0
	MOV	EAX,DWORD [-1816+EBP]
	MOV	ECX,ESI
	MOV	BYTE [189+EAX],CL
	CALL	_io_cli
	LEA	EAX,DWORD [48+EBX]
	MOV	DWORD [84+EBX],EAX
	MOV	DWORD [76+EBX],_asm_end_app
	CALL	_io_sti
	PUSH	0
	PUSH	-1
	PUSH	EBX
	CALL	_task_run
	ADD	ESP,20
	JMP	L126
L127:
	PUSH	-1
	PUSH	DWORD [-1912+EBP]
	CALL	_sheet_updown
	PUSH	EDI
	XOR	EDI,EDI
	CALL	_keywin_off
	MOV	EDX,DWORD [-1896+EBP]
	ADD	ESP,12
	MOV	EAX,DWORD [16+EDX]
	CMP	EAX,2
	JLE	L126
	MOV	EDI,DWORD [12+EDX+EAX*4]
	PUSH	EDI
	CALL	_keywin_on
	POP	EAX
	JMP	L126
L187:
	OR	DWORD [-1892+EBP],2
	CMP	DWORD [-1864+EBP],0
	JS	L194
	TEST	DWORD [-1892+EBP],3840
	JNE	L26
	MOV	EDX,DWORD [-1848+EBP]
	MOV	ECX,DWORD [-1852+EBP]
	SUB	EDX,DWORD [-1864+EBP]
	SUB	ECX,DWORD [-1868+EBP]
	MOV	EAX,DWORD [-1880+EBP]
	MOV	DWORD [-1856+EBP],EDX
	ADD	DWORD [-1888+EBP],ECX
	MOV	DWORD [-1860+EBP],ECX
	LEA	EAX,DWORD [2+EDX+EAX*1]
	AND	EAX,-4
	MOV	EDX,DWORD [-1852+EBP]
	MOV	DWORD [-1884+EBP],EAX
	MOV	DWORD [-1868+EBP],EDX
	JMP	L26
L194:
	MOV	EDX,DWORD [-1908+EBP]
	CMP	DWORD [-1912+EBP],EDX
	JE	L119
	MOV	ECX,DWORD [-1912+EBP]
	TEST	BYTE [33+ECX],2
	JE	L26
L119:
	MOV	EAX,DWORD [-1848+EBP]
	MOV	ECX,DWORD [-1912+EBP]
	MOV	DWORD [-1864+EBP],EAX
	MOV	EDX,DWORD [-1852+EBP]
	MOV	EAX,DWORD [-1912+EBP]
	MOV	ECX,DWORD [16+ECX]
	MOV	DWORD [-1868+EBP],EDX
	MOV	DWORD [-1880+EBP],ECX
	MOV	EAX,DWORD [20+EAX]
	MOV	DWORD [-1888+EBP],EAX
	JMP	L26
L186:
	OR	DWORD [-1892+EBP],1
	CMP	DWORD [-1864+EBP],0
	JS	L195
	TEST	DWORD [-1892+EBP],3840
	JNE	L26
	MOV	EAX,DWORD [-1848+EBP]
	MOV	EDX,DWORD [-1852+EBP]
	SUB	EAX,DWORD [-1864+EBP]
	SUB	EDX,DWORD [-1868+EBP]
	MOV	ECX,DWORD [-1880+EBP]
	MOV	DWORD [-1856+EBP],EAX
	ADD	DWORD [-1888+EBP],EDX
	MOV	DWORD [-1860+EBP],EDX
	LEA	ECX,DWORD [2+EAX+ECX*1]
	AND	ECX,-4
	MOV	EAX,DWORD [-1852+EBP]
	MOV	DWORD [-1884+EBP],ECX
	MOV	DWORD [-1868+EBP],EAX
	JMP	L26
L195:
	MOV	ECX,DWORD [-1912+EBP]
	TEST	BYTE [33+ECX],1
	JE	L102
	MOV	EAX,DWORD [-1908+EBP]
	CMP	ECX,EAX
	JE	L196
L102:
	MOV	ECX,DWORD [-1912+EBP]
	MOV	EAX,DWORD [32+ECX]
	AND	EAX,3840
	CMP	EAX,512
	JE	L197
L106:
	TEST	EAX,EAX
	JNE	L26
	MOV	EDX,DWORD [-1896+EBP]
	MOV	EAX,DWORD [16+EDX]
	SUB	EAX,2
	PUSH	EAX
	PUSH	DWORD [-1912+EBP]
	CALL	_sheet_updown
	CMP	DWORD [-1912+EBP],EDI
	POP	ECX
	POP	EBX
	JE	L108
	CMP	DWORD [-1912+EBP],0
	JE	L108
	PUSH	EDI
	CALL	_keywin_off
	MOV	EDI,DWORD [-1912+EBP]
	PUSH	EDI
	CALL	_keywin_on
	POP	EAX
	POP	EDX
L108:
	CMP	DWORD [-1856+EBP],2
	JLE	L109
	MOV	ECX,DWORD [-1912+EBP]
	MOV	EAX,DWORD [8+ECX]
	SUB	EAX,3
	CMP	DWORD [-1856+EBP],EAX
	JGE	L109
	CMP	DWORD [-1860+EBP],2
	JLE	L109
	CMP	DWORD [-1860+EBP],20
	JG	L109
	MOV	EAX,DWORD [-1848+EBP]
	MOV	EDX,DWORD [-1852+EBP]
	MOV	DWORD [-1864+EBP],EAX
	MOV	ECX,DWORD [16+ECX]
	MOV	EAX,DWORD [-1912+EBP]
	MOV	DWORD [-1868+EBP],EDX
	MOV	DWORD [-1880+EBP],ECX
	MOV	EAX,DWORD [20+EAX]
	MOV	DWORD [-1888+EBP],EAX
L109:
	MOV	EAX,DWORD [-1860+EBP]
	SUB	EAX,5
	CMP	EAX,13
	JA	L26
	MOV	ECX,DWORD [-1912+EBP]
	MOV	EDX,DWORD [8+ECX]
	LEA	EAX,DWORD [-20+EDX]
	CMP	EAX,DWORD [-1856+EBP]
	JG	L111
	LEA	EAX,DWORD [-5+EDX]
	CMP	DWORD [-1856+EBP],EAX
	JGE	L111
	OR	DWORD [-1892+EBP],272
L111:
	LEA	EAX,DWORD [-31+EDX]
	CMP	EAX,DWORD [-1856+EBP]
	JG	L26
	LEA	EAX,DWORD [-21+EDX]
	CMP	DWORD [-1856+EBP],EAX
	JGE	L26
	OR	DWORD [-1892+EBP],288
	JMP	L26
L197:
	OR	DWORD [-1892+EBP],304
	JMP	L106
L196:
	CMP	DWORD [-1920+EBP],0
	JNE	L104
	MOV	EAX,DWORD [20+ECX]
	SUB	EAX,30
	PUSH	EAX
	MOV	EAX,DWORD [16+ECX]
	SUB	EAX,80
	PUSH	EAX
	PUSH	DWORD [-1916+EBP]
	MOV	DWORD [-1920+EBP],1
	CALL	_sheet_slide
	MOV	EDX,DWORD [-1896+EBP]
	MOV	EAX,DWORD [16+EDX]
	DEC	EAX
	PUSH	EAX
	PUSH	DWORD [-1916+EBP]
	CALL	_sheet_updown
	ADD	ESP,20
L104:
	CMP	DWORD [-1920+EBP],2
	JNE	L102
	PUSH	-1
	PUSH	DWORD [-1916+EBP]
	MOV	DWORD [-1920+EBP],3
	CALL	_sheet_updown
	POP	ESI
	POP	EAX
	JMP	L102
L185:
	PUSH	DWORD [-1852+EBP]
	PUSH	DWORD [-1848+EBP]
	PUSH	DWORD [-1896+EBP]
	CALL	_search_sheet
	ADD	ESP,12
	MOV	EDX,DWORD [-1848+EBP]
	MOV	ECX,DWORD [-1852+EBP]
	SUB	EDX,DWORD [16+EAX]
	SUB	ECX,DWORD [20+EAX]
	MOV	DWORD [-1912+EBP],EAX
	MOV	DWORD [-1856+EBP],EDX
	MOV	DWORD [-1860+EBP],ECX
	CMP	DWORD [-1744+EBP],0
	JE	L97
	MOV	EDX,DWORD [-1908+EBP]
	CMP	EAX,EDX
	JE	L97
	PUSH	-1
	PUSH	DWORD [-1916+EBP]
	CALL	_sheet_updown
	POP	EAX
	MOV	DWORD [-1920+EBP],0
	POP	EDX
	JMP	L97
L184:
	MOV	DWORD [-1852+EBP],0
	JMP	L94
L183:
	MOV	DWORD [-1848+EBP],0
	JMP	L93
L178:
	MOV	DWORD [-1808+EBP],EAX
	MOV	EDX,EAX
	CMP	EAX,224
	JE	L198
L40:
	CMP	EDX,127
	JG	L41
	CMP	DWORD [-1836+EBP],0
	JNE	L41
	CMP	DWORD [-1824+EBP],0
	JNE	L42
	MOV	AL,BYTE [_keytable0.0+EDX]
L175:
	MOV	BYTE [-1804+EBP],AL
L45:
	MOV	CL,BYTE [-1804+EBP]
	LEA	EAX,DWORD [-65+ECX]
	CMP	AL,25
	JA	L46
	TEST	DWORD [-1840+EBP],4
	JNE	L168
	CMP	DWORD [-1824+EBP],0
	JE	L48
L46:
	CMP	DWORD [-1836+EBP],1
	JE	L199
L50:
	MOV	EDX,DWORD [-1808+EBP]
	LEA	EAX,DWORD [-71+EDX]
	CMP	EAX,12
	JA	L53
	CMP	EDX,74
	JE	L53
	CMP	EDX,78
	JE	L53
	CMP	DWORD [-1836+EBP],1
	JE	L56
	TEST	DWORD [-1840+EBP],2
	JE	L53
L56:
	MOV	AL,BYTE [_keytable0.0+EDX]
	ADD	EAX,-128
	MOV	BYTE [-1804+EBP],AL
L53:
	CMP	EDX,15
	JE	L200
L57:
	MOV	AL,BYTE [-1804+EBP]
	TEST	AL,AL
	JE	L58
	TEST	EDI,EDI
	JE	L58
	CMP	DWORD [-1828+EBP],0
	JNE	L58
	MOVZX	EAX,AL
	ADD	EAX,256
	PUSH	EAX
	MOV	EAX,DWORD [44+EDI]
	ADD	EAX,16
	PUSH	EAX
	CALL	_fifo32_put
	POP	ECX
	POP	EBX
L58:
	CMP	DWORD [-1808+EBP],87
	JE	L201
L60:
	MOV	EAX,DWORD [-1808+EBP]
	CMP	EAX,42
	JE	L202
L61:
	CMP	EAX,54
	JE	L203
L62:
	CMP	EAX,170
	JE	L204
L63:
	CMP	EAX,182
	JE	L205
L64:
	CMP	EAX,29
	JE	L206
L65:
	CMP	EAX,157
	JE	L207
L68:
	CMP	EAX,56
	JE	L208
L71:
	CMP	EAX,184
	JE	L209
L74:
	CMP	EAX,58
	JE	L210
L77:
	CMP	DWORD [-1808+EBP],69
	JE	L211
L78:
	CMP	DWORD [-1808+EBP],70
	JE	L212
L79:
	MOV	EAX,DWORD [-1808+EBP]
	CMP	EAX,15
	JE	L213
L82:
	CMP	EAX,67
	JE	L81
L80:
	CMP	DWORD [-1808+EBP],46
	JE	L214
L84:
	CMP	DWORD [-1808+EBP],49
	JE	L215
L86:
	MOV	EAX,DWORD [-1808+EBP]
	CMP	EAX,224
	JE	L87
	CMP	DWORD [-1836+EBP],1
	JE	L216
L87:
	CMP	EAX,250
	JE	L217
L88:
	CMP	EAX,254
	JNE	L26
	CALL	_wait_KBC_sendready
	PUSH	DWORD [-1844+EBP]
	PUSH	96
	CALL	_io_out8
	POP	ESI
	POP	EAX
	JMP	L26
L217:
	MOV	DWORD [-1844+EBP],-1
	JMP	L88
L216:
	MOV	DWORD [-1836+EBP],0
	JMP	L87
L215:
	CMP	DWORD [-1828+EBP],0
	JE	L86
	PUSH	EDI
	CALL	_keywin_off
	PUSH	DWORD [-1812+EBP]
	PUSH	DWORD [-1896+EBP]
	CALL	_open_console
	PUSH	16
	PUSH	8
	MOV	EDI,EAX
	PUSH	EAX
	CALL	_sheet_slide
	MOV	ECX,DWORD [-1896+EBP]
	MOV	EAX,DWORD [16+ECX]
	DEC	EAX
	PUSH	EAX
	PUSH	EDI
	CALL	_sheet_updown
	ADD	ESP,32
	PUSH	EDI
	CALL	_keywin_on
	POP	EAX
	JMP	L86
L214:
	CMP	DWORD [-1828+EBP],0
	JE	L84
	TEST	EDI,EDI
	JE	L84
	MOV	EBX,DWORD [44+EDI]
	TEST	EBX,EBX
	JE	L84
	CMP	DWORD [52+EBX],0
	JE	L84
	MOV	AL,BYTE [188+EBX]
	MOV	BYTE [189+EBX],AL
	MOV	ECX,DWORD [-1816+EBP]
	MOVZX	ESI,BYTE [189+ECX]
	MOV	BYTE [189+ECX],AL
	PUSH	LC3
	PUSH	DWORD [164+EBX]
	CALL	_cons_putstr0
	MOV	EDX,DWORD [-1816+EBP]
	MOV	EAX,ESI
	MOV	BYTE [189+EDX],AL
	CALL	_io_cli
	LEA	EAX,DWORD [48+EBX]
	MOV	DWORD [84+EBX],EAX
	MOV	DWORD [76+EBX],_asm_end_app
	CALL	_io_sti
	PUSH	0
	PUSH	-1
	PUSH	EBX
	CALL	_task_run
	ADD	ESP,20
	JMP	L84
L81:
	TEST	EDI,EDI
	JE	L80
	PUSH	EDI
	CALL	_keywin_off
	POP	EAX
	MOV	EAX,DWORD [28+EDI]
	DEC	EAX
	JNE	L83
	MOV	ECX,DWORD [-1896+EBP]
	MOV	EAX,DWORD [16+ECX]
	SUB	EAX,2
L83:
	MOV	EDX,DWORD [-1896+EBP]
	MOV	EDI,DWORD [20+EDX+EAX*4]
	PUSH	EDI
	CALL	_keywin_on
	POP	EAX
	JMP	L80
L213:
	CMP	DWORD [-1832+EBP],0
	JNE	L81
	JMP	L82
L212:
	PUSH	237
	LEA	EBX,DWORD [-76+EBP]
	PUSH	EBX
	XOR	DWORD [-1840+EBP],1
	CALL	_fifo32_put
	PUSH	DWORD [-1840+EBP]
	PUSH	EBX
	CALL	_fifo32_put
	ADD	ESP,16
	JMP	L79
L211:
	PUSH	237
	LEA	EBX,DWORD [-76+EBP]
	PUSH	EBX
	XOR	DWORD [-1840+EBP],2
	CALL	_fifo32_put
	PUSH	DWORD [-1840+EBP]
	PUSH	EBX
	CALL	_fifo32_put
	ADD	ESP,16
	JMP	L78
L210:
	PUSH	237
	LEA	EBX,DWORD [-76+EBP]
	PUSH	EBX
	XOR	DWORD [-1840+EBP],4
	CALL	_fifo32_put
	PUSH	DWORD [-1840+EBP]
	PUSH	EBX
	CALL	_fifo32_put
	ADD	ESP,16
	JMP	L77
L209:
	CMP	DWORD [-1836+EBP],0
	JNE	L75
	AND	DWORD [-1832+EBP],-2
	JMP	L74
L75:
	AND	DWORD [-1832+EBP],-3
	JMP	L74
L208:
	CMP	DWORD [-1836+EBP],0
	JNE	L72
	OR	DWORD [-1832+EBP],1
	JMP	L71
L72:
	OR	DWORD [-1832+EBP],2
	JMP	L71
L207:
	CMP	DWORD [-1836+EBP],0
	JNE	L69
	AND	DWORD [-1828+EBP],-2
	JMP	L68
L69:
	AND	DWORD [-1828+EBP],-3
	JMP	L68
L206:
	CMP	DWORD [-1836+EBP],0
	JNE	L66
	OR	DWORD [-1828+EBP],1
	JMP	L65
L66:
	OR	DWORD [-1828+EBP],2
	JMP	L65
L205:
	AND	DWORD [-1824+EBP],-3
	JMP	L64
L204:
	AND	DWORD [-1824+EBP],-2
	JMP	L63
L203:
	OR	DWORD [-1824+EBP],2
	JMP	L62
L202:
	OR	DWORD [-1824+EBP],1
	JMP	L61
L201:
	MOV	EDX,DWORD [-1896+EBP]
	MOV	EAX,DWORD [16+EDX]
	CMP	EAX,2
	JLE	L60
	SUB	EAX,2
	PUSH	EAX
	PUSH	DWORD [24+EDX]
	CALL	_sheet_updown
	POP	EAX
	POP	EDX
	JMP	L60
L200:
	CMP	DWORD [-1832+EBP],0
	JE	L57
	MOV	BYTE [-1804+EBP],0
	JMP	L57
L199:
	CMP	EDX,53
	JE	L52
	CMP	EDX,28
	JNE	L50
L52:
	MOV	AL,BYTE [_keytable0.0+EDX]
	MOV	BYTE [-1804+EBP],AL
	JMP	L50
L48:
	LEA	EAX,DWORD [32+ECX]
	MOV	BYTE [-1804+EBP],AL
	JMP	L46
L168:
	CMP	DWORD [-1824+EBP],0
	JE	L46
	JMP	L48
L42:
	CMP	DWORD [-1824+EBP],1
	JNE	L45
	MOV	AL,BYTE [_keytable1.1+EDX]
	JMP	L175
L41:
	MOV	BYTE [-1804+EBP],0
	JMP	L45
L198:
	MOV	DWORD [-1836+EBP],1
	JMP	L40
L177:
	CMP	DWORD [-1872+EBP],0
	JNS	L218
	CMP	DWORD [-1884+EBP],2147483647
	JNE	L219
	PUSH	DWORD [-1816+EBP]
	CALL	_task_sleep
	CALL	_io_sti
	JMP	L172
L219:
	CALL	_io_sti
	JMP	L173
L218:
	CALL	_io_sti
	PUSH	DWORD [-1876+EBP]
	PUSH	DWORD [-1872+EBP]
	PUSH	DWORD [-1904+EBP]
	CALL	_sheet_slide
	MOV	DWORD [-1872+EBP],-1
	JMP	L174
L176:
	PUSH	EBX
	CALL	_fifo32_get
	MOV	DWORD [-1844+EBP],EAX
	CALL	_wait_KBC_sendready
	PUSH	DWORD [-1844+EBP]
	PUSH	96
	CALL	_io_out8
	ADD	ESP,12
	JMP	L29
L2:
	PUSH	145472
	PUSH	3932160
	CALL	_memman_alloc_4k
	POP	EBX
	MOV	ECX,EAX
	POP	EAX
	MOV	DWORD [-1808+EBP],4096
	MOV	EAX,4096
L8:
	MOV	BYTE [EAX+ECX*1],-1
	MOV	EAX,DWORD [-1808+EBP]
	INC	EAX
	MOV	DWORD [-1808+EBP],EAX
	CMP	EAX,145471
	JLE	L8
	JMP	L3
	GLOBAL	_keywin_off
_keywin_off:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	PUSH	0
	MOV	EBX,DWORD [8+EBP]
	PUSH	EBX
	CALL	_change_wtitle
	TEST	BYTE [32+EBX],32
	POP	EAX
	POP	EDX
	JNE	L222
L220:
	MOV	EBX,DWORD [-4+EBP]
	LEAVE
	RET
L222:
	PUSH	3
	MOV	EAX,DWORD [44+EBX]
	ADD	EAX,16
	PUSH	EAX
	CALL	_fifo32_put
	POP	EBX
	POP	EAX
	JMP	L220
	GLOBAL	_keywin_on
_keywin_on:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	PUSH	1
	MOV	EBX,DWORD [8+EBP]
	PUSH	EBX
	CALL	_change_wtitle
	TEST	BYTE [32+EBX],32
	POP	EAX
	POP	EDX
	JNE	L225
L223:
	MOV	EBX,DWORD [-4+EBP]
	LEAVE
	RET
L225:
	PUSH	2
	MOV	EAX,DWORD [44+EBX]
	ADD	EAX,16
	PUSH	EAX
	CALL	_fifo32_put
	POP	ECX
	POP	EBX
	JMP	L223
	GLOBAL	_open_constask
_open_constask:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	ESI
	PUSH	EBX
	CALL	_task_alloc
	PUSH	512
	PUSH	3932160
	MOV	EBX,EAX
	CALL	_memman_alloc_4k
	PUSH	65536
	PUSH	3932160
	MOV	ESI,EAX
	CALL	_memman_alloc_4k
	MOV	EDX,DWORD [8+EBP]
	MOV	DWORD [76+EBX],_console_task
	MOV	DWORD [172+EBX],EAX
	ADD	EAX,65524
	MOV	DWORD [100+EBX],EAX
	MOV	DWORD [116+EBX],8
	MOV	DWORD [120+EBX],16
	MOV	DWORD [124+EBX],8
	MOV	DWORD [128+EBX],8
	MOV	DWORD [132+EBX],8
	MOV	DWORD [136+EBX],8
	MOV	DWORD [4+EAX],EDX
	MOV	EDX,DWORD [100+EBX]
	MOV	EAX,DWORD [12+EBP]
	MOV	DWORD [8+EDX],EAX
	PUSH	2
	PUSH	2
	PUSH	EBX
	CALL	_task_run
	LEA	EAX,DWORD [16+EBX]
	PUSH	EBX
	PUSH	ESI
	PUSH	128
	PUSH	EAX
	CALL	_fifo32_init
	LEA	ESP,DWORD [-8+EBP]
	MOV	EAX,EBX
	POP	EBX
	POP	ESI
	POP	EBP
	RET
[SECTION .data]
LC5:
	DB	"Console",0x00
[SECTION .text]
	GLOBAL	_open_console
_open_console:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	ESI
	PUSH	EBX
	PUSH	DWORD [8+EBP]
	CALL	_sheet_alloc
	MOV	EBX,EAX
	CALL	_get_bpp
	SAR	EAX,3
	IMUL	EAX,EAX,42240
	PUSH	EAX
	PUSH	3932160
	CALL	_memman_alloc_4k
	PUSH	-1
	PUSH	165
	MOV	ESI,EAX
	PUSH	256
	PUSH	EAX
	PUSH	EBX
	CALL	_sheet_setbuf
	ADD	ESP,32
	PUSH	0
	PUSH	0
	PUSH	LC5
	PUSH	165
	PUSH	256
	PUSH	ESI
	CALL	_make_window
	PUSH	0
	PUSH	128
	PUSH	240
	PUSH	28
	PUSH	8
	PUSH	EBX
	CALL	_make_textbox
	ADD	ESP,48
	PUSH	DWORD [12+EBP]
	PUSH	EBX
	CALL	_open_constask
	OR	DWORD [32+EBX],32
	MOV	DWORD [44+EBX],EAX
	LEA	ESP,DWORD [-8+EBP]
	MOV	EAX,EBX
	POP	EBX
	POP	ESI
	POP	EBP
	RET
	GLOBAL	_open_omnaomi
_open_omnaomi:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	PUSH	DWORD [8+EBP]
	CALL	_sheet_alloc
	MOV	EBX,EAX
	CALL	_get_bpp
	SAR	EAX,3
	IMUL	EAX,EAX,496
	PUSH	EAX
	PUSH	3932160
	CALL	_memman_alloc_4k
	PUSH	99
	PUSH	16
	PUSH	31
	PUSH	EAX
	PUSH	EBX
	CALL	_sheet_setbuf
	ADD	ESP,32
	PUSH	0
	PUSH	0
	PUSH	EBX
	CALL	_make_omnaomi
	MOV	EAX,EBX
	OR	DWORD [32+EBX],512
	MOV	EBX,DWORD [-4+EBP]
	LEAVE
	RET
	GLOBAL	_close_constask
_close_constask:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	MOV	EBX,DWORD [8+EBP]
	PUSH	EBX
	CALL	_task_sleep
	PUSH	65536
	PUSH	DWORD [172+EBX]
	PUSH	3932160
	CALL	_memman_free_4k
	PUSH	512
	PUSH	DWORD [16+EBX]
	PUSH	3932160
	CALL	_memman_free_4k
	MOV	DWORD [4+EBX],0
	MOV	EBX,DWORD [-4+EBP]
	LEAVE
	RET
	GLOBAL	_close_console
_close_console:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	ESI
	PUSH	EBX
	MOV	EBX,DWORD [8+EBP]
	MOV	ESI,DWORD [44+EBX]
	PUSH	42240
	PUSH	DWORD [EBX]
	PUSH	3932160
	CALL	_memman_free_4k
	PUSH	EBX
	CALL	_sheet_free
	MOV	DWORD [8+EBP],ESI
	ADD	ESP,16
	LEA	ESP,DWORD [-8+EBP]
	POP	EBX
	POP	ESI
	POP	EBP
	JMP	_close_constask
	GLOBAL	_search_sheet
_search_sheet:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EDI
	PUSH	ESI
	MOV	EDI,DWORD [8+EBP]
	PUSH	EBX
	MOV	EBX,DWORD [16+EDI]
	DEC	EBX
	TEST	EBX,EBX
	JLE	L240
L238:
	MOV	ECX,DWORD [20+EDI+EBX*4]
	MOV	EDX,DWORD [16+EBP]
	MOV	ESI,DWORD [12+EBP]
	SUB	EDX,DWORD [20+ECX]
	SUB	ESI,DWORD [16+ECX]
	JS	L234
	MOV	EAX,DWORD [8+ECX]
	CMP	ESI,EAX
	JGE	L234
	TEST	EDX,EDX
	JS	L234
	CMP	EDX,DWORD [12+ECX]
	JGE	L234
	IMUL	EDX,EAX
	MOV	EAX,DWORD [ECX]
	ADD	EDX,ESI
	MOVZX	EAX,BYTE [EDX+EAX*1]
	CMP	EAX,DWORD [24+ECX]
	JNE	L241
L234:
	DEC	EBX
	TEST	EBX,EBX
	JG	L238
L240:
	XOR	EAX,EAX
L231:
	POP	EBX
	POP	ESI
	POP	EDI
	POP	EBP
	RET
L241:
	MOV	EAX,ECX
	JMP	L231
